import 'babel-polyfill' //放置顶部
import Es6Promise from 'es6-promise'//放置顶部
import ResizeObserver from 'resize-observer-polyfill';
import Vue from "vue";
import "normalize.css";
import dayjs from "dayjs";
import lodash from "lodash";
import store from "@/store";
import router from "@/router";
import autoFit from "autofit.js"
import VConsole from 'vconsole';
import * as utils from '@/utils'; // 汇总组件导出
import x2js from 'x2js'
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/base.css";
import "element-ui/lib/theme-chalk/index.css";
import Structure from "@/components/structure";
import "@/components/public/svg-icon/icons";
import "@/components/assets/iconfont/iconfont.css";
import Vant from 'vant';
import 'vant/lib/index.css';
import '@/utils/rem';
// 全局自动指令
import Directives from '@/directives';
import "swiper/dist/css/swiper.min.css";

import Editor from "@/components/public/layer/template/formEditor2";

import splitPane from 'vue-splitpane'
Vue.component('split-pane', splitPane);

Es6Promise.polyfill();

// 开发环境&测试环境
if((process.env.NODE_ENV) === 'development'){
  // new VConsole();
}

// 增加判断如果不支持当前依赖再设置即可
if (!(window.ResizeObserver)) {
  window.ResizeObserver = ResizeObserver;
}

Vue.use(Vant);
Vue.use(ElementUI);

// 挂载全局定义副文本组件
Vue.component('Editor', Editor)

// 指令集
for (let key in Directives) {
  Vue.directive(key,Directives[key])
}

// 项目接口
Vue.prototype.$day = dayjs;
Vue.prototype.$autofit = autoFit;
Vue.prototype.$lodash = lodash;
Vue.prototype.$utils = utils.default.utils;
Vue.config.productionTip = false;
Vue.prototype.$x2js = new x2js({ escapeMode: false });
new Vue({
  router,
  store,
  render: (h) => h(Structure),
}).$mount("#app");
